﻿package com.pandemicode.framework.smtp.base {
	import com.pandemicode.framework.smtp.mailer.parts.Boundary;
	import com.pandemicode.framework.smtp.mailer.Mailer;
	/**
	* @author Mike Lawrence
	*/
	public class ContentTypeHeaderBase {
		private var _contentType:String;
		private var _type:String;
		private var _boundary:Boundary;
		private var _extraHeaders:String;
		
		public function get boundary():Boundary { return this._boundary; }
		
		public function ContentTypeHeaderBase(contentType:String, type:String = null, extraHeaders:String = null) {
			this._contentType = contentType;
			this._type = type;
			this._extraHeaders = extraHeaders;
			this._boundary = new Boundary();
		}
		
		public function toString():String {
			var s:String = "Content-Type: " + this._contentType +";";
			if(this._type != null)
				s += "type=\""+this._type+"\";";
			s += "boundary =\"" + this._boundary.toString() + "\"" + Mailer.NEWLINE;
			s += this._extraHeaders;
			return s;
		}
	}
}
